package com.qkl.xiatang.app.utils;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;

public class SHAUtils {

    public static String signature(String str){
        str = StringUtils.trimToEmpty(str);
        if(StringUtils.isEmpty(str)){
            return "";
        }
        return DigestUtils.sha1Hex(str);
    }

    public static String printSign(String user,String ukey,String stime){
        return signature(user + ukey + stime);
    }

    public static String printStime(){
        return String.valueOf(System.currentTimeMillis() / 1000);
    }

    public static void main(String[] args) {
        System.out.println(signature("523333+4444444+9sdfjlsdjflsdjfsldfsdflsdkllkfsdklfl"));
    }
}
